import React from 'react';
import { CollectC } from '../../components';

class CollectCDemo extends React.Component {
  constructor() {
    super();
    this.state = {
      dataSource: [
        {
          name: '买入开仓数量', // 名称
          value: 1000000, // 数值
          toFixed: 2, // 几位小数
        },
        {
          name: '买入开仓数量',
          value: null,
          toFixed: 0,
        },
        {
          name: '买入开仓数量',
          value: 100,
          toFixed: 4,
        },
        {
          name: '买入开仓数量',
          value: 0,
          toFixed: 4,
        },
      ],
      type: '1', // 1单行展示 2上下两行展示
      status: 0,
    };
  }

  render() {
    setTimeout(() => {
      this.setState({
        status: 1,
      });
    }, 2000);
    return (
      <div>
        <div style={{ padding: '20px' }}>
          <CollectC dataSource={this.state.dataSource} type='1' isloading={!this.state.status} />
        </div>
        <div style={{ padding: '20px' }}>
          <CollectC dataSource={this.state.dataSource} type='2' logoName='普通用户' />
        </div>
      </div>
    );
  }
}
export default CollectCDemo;
